package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface MemberMapper {

    //添加会员
    @Insert("insert into t_member(name,sex,idCard,phoneNumber,regTime) " +
            "values(#{name},#{sex},#{idCard},#{telephone},#{regTime})")
    void registerMember(String name, String sex, String idCard, String telephone, LocalDateTime regTime);

    //根据idCard查询会员
    @Select("select * from t_member where idCard=#{idCard}")
    Member findMember(String idCard);

    //根据手机号查询会员
    @Select("select * from t_member where phoneNumber=#{telephone}")
    Member findMemberByTelephone();
}
